package com.beeantec.jnrerc.modules.course.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.beeantec.jnrerc.entity.CourseChapterPeriod;
import com.beeantec.jnrerc.mapper.CourseChapterPeriodMapper;
import com.beeantec.jnrerc.modules.course.service.CourseChapterPeriodService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseChapterPeriodServiceImpl extends ServiceImpl<CourseChapterPeriodMapper, CourseChapterPeriod> implements CourseChapterPeriodService {

    @Override
    public List<CourseChapterPeriod> listByChapterIdAndStatusId(Long chapterId, Integer statusId) {
        QueryWrapper<CourseChapterPeriod> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(CourseChapterPeriod::getChapterId, chapterId).eq(CourseChapterPeriod::getStatusId,statusId);
        return baseMapper.selectList(wrapper);
    }

}
